<template>
    <div>
        <van-nav-bar
            title="店铺详情"
            left-text="返回"
            left-arrow
            @click-left="onClickLeft"
            fixed=true
        />  
        <van-cell-group class="a">
            <van-cell value="内容jjjjjjjjjj" >
                 <van-image
                    round
                    width="1.4rem"
                    height="1.4rem"
                    src="https://img.yzcdn.cn/vant/cat.jpeg"
                />
                <template slot="title">
                    <span class="custom-text">{{ shopInfo.name }}</span>
                    <van-tag type="danger">平台认证</van-tag>
                    <van-tag type="warning">已缴保证金</van-tag>
                    <van-tag plain hairline type="info">实体店</van-tag>
                </template>
            </van-cell>
            <van-cell :title="shopInfo.address" value="导航" label="地址" is-link  @click="toMap()">
               
            </van-cell>
            <van-cell :title="shopInfo.describe"  label="简介" />
        </van-cell-group>
    </div>
</template>

<script>
export default {
    name: 'ShopDetail',
    data() {
        return {
            shopInfo:[]
        }
    },
    created() {
        this.shopInfo = this.$route.query.shopInfo
        this.flag = this.$route.query.flag
    },
    methods: {
        onClickLeft(){
            if(this.flag){
                this.$router.go(-1)
            }else{
                this.$router.push({
                path: '/shop',
                query: {
                    addressname: this.shopInfo.address,
                    shopInfo: this.shopInfo
                }
            })
            }
        },
        toMap() {
            this.$router.push({
                path: '/map',
                query: {
                    addressname: this.shopInfo.address,
                    shopInfo: this.shopInfo
                }
            })
        }
    }
}
</script>


<style>
    .goods-wrapper {
    box-sizing: border-box;
    flex-wrap: wrap;
    justify-content: space-around;
    width: 100%;
}

.a{
    padding-top: 50px;
}

.home-tab {
        padding-bottom: 20px;
    }

     .van-tab {
            font-size: 16px;
            font-weight: 400;
            color: #424242;
        }

        .van-tabs__line {
            width: 38px;
        }

        .van-tab--active {
            font-weight: 600;
            color: #333;
        }

    .prompt {
        font-size: 20px;
        color: #333;
    }

    .y-flex {
    display: flex;
    flex-direction: column;
}
</style>
